tetralat.debug.init = function() {
	var selida = getelid('selida');
	if (notSet(selida)) { return; }
	selida.style.marginLeft = '0px';
	selida.style.marginRight = '0px';

	var main = getelid('main');
	if (notSet(main)) { return; }
	var w = parseInt((document.body.clientWidth - main.clientWidth) * 0.95);

	var debug = getelid('debug');
	if (notSet(debug)) { return; }
	debug.style.top = '0px';
	debug.style.right = '-' + w + 'px';
	debug.style.width = w + 'px';

	tetralat.debug.clear();
};

tetralat.debug.clear = function() {
	var debug = getelid('debug');
	if (notSet(debug)) { return; }

	svisePeriexomeno(debug);
};

tetralat.debug.minima = function(msg, esoxi) {
	var debug = getelid('debug');
	if (notSet(debug)) { return; }

	var p = document.createElement('div');
	p.setAttribute('class', 'debugMinima');

	if (isSet(esoxi)) {
		p.style.marginLeft = esoxi;
	}

	var t = document.createTextNode(msg);
	p.appendChild(t);
	debug.appendChild(p);
	debug.scrollTop = debug.scrollHeight;
};

tetralat.debug.titlos = function(msg, klasi) {
	var debug = getelid('debug');
	if (notSet(debug)) { return; }

	var p = document.createElement('div');
	p.setAttribute('class', isSet(klasi) ? klasi : 'debugTitlos');

	if (isSet(msg)) {
		var t = document.createTextNode(msg);
		p.appendChild(t);
	}

	debug.appendChild(p);
};

tetralat.debug.ipotitlos = function(msg) {
	tetralat.debug.titlos(msg, 'debugIpotitlos');
};
